package com.alks.function.controller.stockdept.pcfactorystockquery;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.RoleCheck;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.stockdept.pcfactorystockwork.StcColDetRequest;
import com.alks.function.data.request.stockdept.pcfactorystockwork.StcColHeadRequest;
import com.alks.function.service.stockdept.pcfactorystockquery.IStcColDefService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@ApiRestController("/pcFactorStockQuery")
@Api(value = "仓储部查询",tags = "仓储部-仓储工厂作业-鞋面缴库部门定义")
@RequiredArgsConstructor
@RoleCheck(prgIds = {"160117"})
public class StcColDefController {
    private final IStcColDefService service;

    @GetMapping("/getStcColHeadQuery")
    @ApiOperation(value = "鞋面缴库部门定义-部门定义查询-查询", tags = "仓储部-仓储工厂作业-鞋面缴库部门定义")
    public ResponseInfo getStcColHeadQuery() {
        return service.getStcColHeadQuery();
    }

    @PutMapping("/stcColHeadAdd")
    @ApiOperation(value = "鞋面缴库部门定义-部门定义新增-新增", tags = "仓储部-仓储工厂作业-鞋面缴库部门定义")
    public ResponseInfo stcColHeadAdd(@RequestBody StcColHeadRequest request) {
        return service.stcColHeadAdd(request);
    }

    @PutMapping("/stcColHeadUpdate")
    @ApiOperation(value = "鞋面缴库部门定义-部门定义更新-更新", tags = "仓储部-仓储工厂作业-鞋面缴库部门定义")
    public ResponseInfo stcColHeadUpdate(@RequestBody StcColHeadRequest request) {
        return service.stcColHeadUpdate(request);
    }
    
    @PostMapping("/stcColHeadDelete")
    @ApiOperation(value = "鞋面缴库部门定义-部门定义删除-删除", tags = "仓储部-仓储工厂作业-鞋面缴库部门定义")
    public ResponseInfo stcColHeadDelete(@RequestParam@ApiParam("左边的组别代码") String collectDept) {
        return service.stcColHeadDelete(collectDept);
    }

    @GetMapping("/getStcColDetailQuery")
    @ApiOperation(value = "鞋面缴库部门定义-分厂组别查询-查询", tags = "仓储部-仓储工厂作业-鞋面缴库部门定义")
    public ResponseInfo getStcColDetailQuery(@RequestParam@ApiParam("左边的组别代码") String collectDept) {
        return service.getStcColDetailQuery(collectDept);
    }

    @PutMapping("/stcColDetailAdd")
    @ApiOperation(value = "鞋面缴库部门定义-分厂组别新增-新增", tags = "仓储部-仓储工厂作业-鞋面缴库部门定义")
    public ResponseInfo stcColDetailAdd(@RequestBody StcColDetRequest request) {
        return service.stcColDetailAdd(request);
    }

    @PutMapping("/stcColDetailUpdate")
    @ApiOperation(value = "鞋面缴库部门定义-分厂组别更新-更新", tags = "仓储部-仓储工厂作业-鞋面缴库部门定义")
    public ResponseInfo stcColDetailUpdate(@RequestBody StcColDetRequest request) {
        return service.stcColDetailUpdate(request);
    }

    @PostMapping("/stcColDetailDelete")
    @ApiOperation(value = "鞋面缴库部门定义-分厂组别删除-删除", tags = "仓储部-仓储工厂作业-鞋面缴库部门定义")
    public ResponseInfo stcColDetailDelete(@RequestParam@ApiParam("左边的组别代码") String collectDept,
                                           @RequestParam@ApiParam("右边的组别代码") String deptNo) {
        return service.stcColDetailDelete(collectDept,deptNo);
    }
}
